<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    990. Verifying an Alien Dictionary
   </h1>
   <p>
    In an alien language, surprisingly they also use english lowercase letters, but possibly&nbsp;in a different
    <code>
     order
    </code>
    . The&nbsp;
    <code>
     order
    </code>
    of the alphabet&nbsp;is some permutation&nbsp;of lowercase letters.
   </p>
   <p>
    Given a sequence of
    <code>
     words
    </code>
    &nbsp;written in the alien language,&nbsp;and the
    <code>
     order
    </code>
    of the alphabet,&nbsp;return
    <code>
     true
    </code>
    if and only if the given
    <code>
     words
    </code>
    &nbsp;are sorted lexicographicaly in this alien language.
   </p>
   <p>
    &nbsp;
   </p>
   <div>
    <p>
     <strong>
      Example 1:
     </strong>
    </p>
    <pre>
<strong>Input: </strong>words = <span id="example-input-1-1">["hello","leetcode"]</span>, order = <span id="example-input-1-2">"hlabcdefgijkmnopqrstuvwxyz"</span>
<strong>Output: </strong><span id="example-output-1">true</span>
<strong>Explanation: </strong><span id="example-output-1">As 'h' comes before 'l' in this language, then the sequence is sorted.</span>
</pre>
    <div>
     <p>
      <strong>
       Example 2:
      </strong>
     </p>
     <pre>
<strong>Input: </strong>words = <span id="example-input-2-1">["word","world","row"]</span>, order = <span id="example-input-2-2">"worldabcefghijkmnpqstuvxyz"</span>
<strong>Output: </strong><span id="example-output-2">false</span>
<strong>Explanation: </strong><span id="example-output-1">As 'd' comes after 'l' in this language, then words[0] &gt; words[1], hence the sequence is unsorted.</span>
</pre>
     <div>
      <p>
       <strong>
        Example 3:
       </strong>
      </p>
      <pre>
<strong>Input: </strong>words = <span id="example-input-3-1">["apple","app"]</span>, order = <span id="example-input-3-2">"abcdefghijklmnopqrstuvwxyz"</span>
<strong>Output: </strong><span id="example-output-3">false
</span><strong>Explanation: </strong>The first three characters "app" match, and the second string is shorter (in size.) According to lexicographical rules "apple" &gt; "app", because 'l' &gt; '&empty;', where '&empty;' is defined as the blank character which is less than any other character (<a href="https://en.wikipedia.org/wiki/Lexicographical_order" target="_blank">More info</a>).
</pre>
      <p>
       &nbsp;
      </p>
      <p>
       <strong>
        Note:
       </strong>
      </p>
      <ol>
       <li>
        <code>
         1 &lt;= words.length &lt;= 100
        </code>
       </li>
       <li>
        <code>
         1 &lt;= words[i].length &lt;= 20
        </code>
       </li>
       <li>
        <code>
         order.length == 26
        </code>
       </li>
       <li>
        All characters in
        <code>
         words[i]
        </code>
        and
        <code>
         order
        </code>
        are english lowercase letters.
       </li>
      </ol>
     </div>
    </div>
   </div>
  </div>
  <div>
   <h1 class="question_title">
    990. 验证外星语词典
   </h1>
   <p>
    某种外星语也使用英文小写字母，但可能顺序
    <code>
     order
    </code>
    不同。字母表的顺序（
    <code>
     order
    </code>
    ）是一些小写字母的排列。
   </p>
   <p>
    给定一组用外星语书写的单词
    <code>
     words
    </code>
    ，以及其字母表的顺序
    <code>
     order
    </code>
    ，只有当给定的单词在这种外星语中按字典序排列时，返回
    <code>
     true
    </code>
    ；否则，返回
    <code>
     false
    </code>
    。
   </p>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     示例 1：
    </strong>
   </p>
   <pre><strong>输入：</strong>words = ["hello","leetcode"], order = "hlabcdefgijkmnopqrstuvwxyz"
<strong>输出：</strong>true
<strong>解释：</strong>在该语言的字母表中，'h' 位于 'l' 之前，所以单词序列是按字典序排列的。</pre>
   <p>
    <strong>
     示例 2：
    </strong>
   </p>
   <pre><strong>输入：</strong>words = ["word","world","row"], order = "worldabcefghijkmnpqstuvxyz"
<strong>输出：</strong>false
<strong>解释：</strong>在该语言的字母表中，'d' 位于 'l' 之后，那么 words[0] &gt; words[1]，因此单词序列不是按字典序排列的。</pre>
   <p>
    <strong>
     示例 3：
    </strong>
   </p>
   <pre><strong>输入：</strong>words = ["apple","app"], order = "abcdefghijklmnopqrstuvwxyz"
<strong>输出：</strong>false
<strong>解释：</strong>当前三个字符 "app" 匹配时，第二个字符串相对短一些，然后根据词典编纂规则 "apple" &gt; "app"，因为 'l' &gt; '&empty;'，其中 '&empty;' 是空白字符，定义为比任何其他字符都小（<a href="https://baike.baidu.com/item/%E5%AD%97%E5%85%B8%E5%BA%8F" target="_blank">更多信息</a>）。
</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     提示：
    </strong>
   </p>
   <ol>
    <li>
     <code>
      1 &lt;= words.length &lt;= 100
     </code>
    </li>
    <li>
     <code>
      1 &lt;= words[i].length &lt;= 20
     </code>
    </li>
    <li>
     <code>
      order.length == 26
     </code>
    </li>
    <li>
     在&nbsp;
     <code>
      words[i]
     </code>
     &nbsp;和&nbsp;
     <code>
      order
     </code>
     &nbsp;中的所有字符都是英文小写字母。
    </li>
   </ol>
  </div>
 </body>
</html>